package com.alex.seo.service.scheduler.dto;

import com.alex.seo.service.scheduler.Job;
import com.alex.seo.service.scheduler.JobScheduler;

public class JobDTO<JobParamType> {

	private JobScheduler scheduler;

	private Class<? extends Job<JobParamType>> job;

	private JobParamType param;

	private String jobId;

	private JobDTO(Class<? extends Job<JobParamType>> job, JobScheduler scheduler, String jobId) {
		this.job = job;
		this.jobId = jobId;
		this.scheduler = scheduler;
	}

	public static <JobParamType> JobDTO<JobParamType> create(Class<? extends Job<JobParamType>> job, JobScheduler scheduler, String jobId) {
		return new JobDTO<JobParamType>(job, scheduler, jobId);
	}

	public JobDTO<JobParamType> withParam(JobParamType param) {
		this.param = param;
		return this;
	}

	public JobScheduler getScheduler() {
		return scheduler;
	}

	public Class<? extends Job<JobParamType>> getJob() {
		return job;
	}

	public JobParamType getParam() {
		return param;
	}

	public String getJobId() {
		return jobId;
	}
}
